package com.oocl.customer.servlet;

import java.io.IOException;
import java.net.ConnectException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oocl.customersystem.dto.Food;
import com.oocl.customersystem.dto.MUserFoodList;
import com.oocl.customersystem.service.FoodManager;
import com.oocl.customersystem.service.MUserFoodManager;
import com.oocl.customersystem.service.impl.FoodManagerImpl;
import com.oocl.customersystem.service.impl.MuserFoodManagerImpl;


public class TestServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		MUserFoodManager manager=new MuserFoodManagerImpl();
		String uri="http://127.0.0.1:8089/merchantv2/foodlist2c";
		
		String par="mid=123456789123456789";
		try {
			MUserFoodList mufl=manager.getMUserFoodList(uri, par);
			System.out.println(mufl.getfList().size());
			request.setAttribute("flist", mufl.getfList());		
			request.getRequestDispatcher("animatev2.jsp").forward(request, response);
		} catch (ConnectException e) {
			request.getRequestDispatcher("error.jsp").forward(request, response);//连接出错
		}	
	}

}
